public class AriTest {
    public static void main(String[] args) {
        //除法运算
        int num1 = 12;
        int num2 = 5;
        int num3 = num1 / num2;  //整型除以整形，会得到整除结果
        double num4 = (double) num1 / num2; // 浮点型参与除法，会得到精确结果
        System.out.println(num3);
        System.out.println(num4);

        //取余运算，结果与被模数的符号相同
        int m1 = -12;
        int n1 = 5;
        System.out.println(m1 % n1); //-2

        int m2 = -12;
        int n2 = -5;
        System.out.println(m2 % n2);//-2

        int m3 = 12;
        int n3 = -5;
        System.out.println(m3 % n3);//2

        //自增1
        byte b = 10;
        b = (byte) (b + 1); // 需要强制转换回来
        System.out.println(b);
        b++; // 可实现自增
        System.out.println(b);
        b += 1;
        System.out.println(b);

    }
}
